Update service_create and service_show to optionally return password#50
Merged
nathanjcochran merged 9 commits intomainfrom Oct 10, 2025
Merged
Update service_create and service_show to optionally return password#50nathanjcochran merged 9 commits intomainfrom
service_create and service_show to optionally return password#50nathanjcochran merged 9 commits intomainfrom
Conversation
…ue but password_storage=none
…o connection string and password
4b18e04 to
1ac8f86
Compare
1ac8f86 to
ac998a6
Compare
murrayju
approved these changes
Oct 10, 2025
| type ServiceGetInput struct { | ||
| ServiceID string `json:"service_id"` | ||
| ServiceID string `json:"service_id"` | ||
| WithPassword bool `json:"with_password,omitempty"` |
Member
There was a problem hiding this comment.
What does omitempty do for us on an input type? Does it make it optional?
Member
Author
There was a problem hiding this comment.
Yes. But this is really just a convention of the github.com/google/jsonschema-go library that github.com/modelcontextprotocol/go-sdk/mcp uses under the hood (for normal JSON unmarshalling, omitempty doesn't have any effect).
See these docs for more info on how jsonschema-go generates JSON schemas from structs. In particular:
Structs have schema type "object", and disallow additionalProperties. Their properties are derived from exported struct fields, using the struct field JSON name. Fields that are marked "omitempty" are considered optional; all other fields become required properties.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Slack thread for background.
Updates the
service_createandservice_showMCP tools to function more liketiger service createandtiger service describe, following the changes made in #32.Specifically, both MCP tools now return a
connection_stringfield in the response. Additionally, they accept a newwith_passwordparameter, which defaults tofalse. If set totrue, apasswordfield is returned in the response, and the password is also included in the returned connection string. This makes it possible for AI assistants to get access to a service's password and connection string, which was previously not possible via the MCP tools (which made it challenging for AI assistants to connect to a database or configure an application with database credentials).I also tried to clean up and de-duplicate some repeated code.
Closes AGE-205